chrome.contextMenus.create({
	id:"fsPic-contextMenu",
	title:"全屏浏览图片",
	contexts:["all"]

}, function(){}) 
chrome.contextMenus.onClicked.addListener(function(info, tab){
    chrome.tabs.sendMessage(tab.id, {
        topic:"fsPic"
    }, function (){}) 

})
chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {
	if (request.topic == "css"){
        chrome.tabs.insertCSS(sender.tab.id, {file:request.file}, function(){}) 
    }else if(request.topic == "fullscreen"){
    	chrome.windows.update(chrome.windows.WINDOW_ID_CURRENT, {state:"fullscreen"}, function (){}) 
    }else if(request.topic == "maximized"){
    	chrome.windows.update(chrome.windows.WINDOW_ID_CURRENT, {state:"maximized"}, function (){}) 
    }
}); 
